<template>
	<page-body>
		<view class="page">
			<view class="flex flex-direction align-stretch benben-position-layout flex index_flex_0"
				:style="{height:(194+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center flex-sub index_fd0_0'>
					<view class='flex flex-wrap align-center flex-sub' @tap.stop="pickerDiy1715242438727=true">
						<image class='index_fd0_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"128.png"'></image>
						<text class='flex-sub index_fd0_0_c0_c1'>{{schoolLable}}</text>
					</view>
				</view>
				<view class='flex flex-wrap align-center index_fd0_1'>
					<view class='flex flex-wrap align-center index_fd0_1_c0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/index/searchye/searchye`">
						<image class='index_fd0_1_c0_c0' mode="aspectFit" :src='STATIC_URL+"14.png"'></image>
						<benben-input class='flex-sub index_fd0_1_c0_c1' type="text" :placeholder="`搜索内容`"
							confirm-type="done" :maxlength="-1" :adjust-position="false" :disabled='true'
							placeholder-style="color:rgba(153, 153, 153, 1);font-size:24rpx" />
					</view>
					<view class='flex flex-wrap align-center index_fd0_1_c1' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/index/myNew/myNew`">
						<image class='index_fd0_1_c1_c0' mode="aspectFit" :src='STATIC_URL+"6.png"'></image>
						<benben-message-num class='index_fd0_1_c1_c1' :message-num="new_msg_num.all" size='24'
							color='#fff' background-color='red'>
						</benben-message-num>
					</view>
					<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/index/price/price`">
						<image class='index_fd0_1_c1_c0' mode="aspectFit" :src='STATIC_URL+"7.png"'></image>
					</view>
				</view>

			</view>
			<view :style="{height: (194+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-wrap align-center justify-center benben-flex-layout index_flex_1"
				v-if=" imgList.length>0">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd1_0" @change="bannerIndexfd1_0 = $event.detail.current"
						class='flex position-relative index_fd1_0' previous-margin="0rpx" next-margin="0rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='true' :circular='true'>

						<template v-for='(item,key0) in imgList'>
							<swiper-item class='flex  index_fd1_0' :key='key0'>
								<image class='index_fd1_0' mode="aspectFill" :src='item.thumb'
									@tap.stop="dynamicJump(item.href)"></image>
							</swiper-item>
						</template>

					</swiper>
					<view style="position: absolute"
						class="flex dot flex align-center justify-center index_swiperDotfd1_0">
						<view class='flex flex align-center justify-center index_numberfd1_0_c0'>
							<text>{{bannerIndexfd1_0+1}}</text>
							<text>/</text>
							<text>{{(imgList.length)}}</text>
						</view>

					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout index_flex_2">
				<view class='flex flex-wrap align-center justify-between index_fd2_0'>
					<view class='flex align-end self-center index_fd2_0_c0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/inSchool/restaurant/restaurant`">
						<view class='flex flex-direction flex-wrap align-stretch index_fd2_0_c0_c0'>
							<text class='index_fd2_0_c0_c0_c0'>校园餐饮</text>
							<text class='index_fd2_0_c0_c0_c1'>Restaurant</text>
							<image class='index_fd2_0_c0_c0_c2' mode="aspectFit" :src='STATIC_URL+"103.png"'></image>
						</view>
						<!-- <image class='index_fd2_0_c0_c1' mode="aspectFit" src='/static/189.png'></image> -->
						<image class='index_fd2_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"104.png"'></image>
					</view>
					<view class='flex align-end self-center index_fd2_0_c0' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/release/release/release?tabs=1`">
						<view class='flex flex-direction flex-wrap align-stretch index_fd2_0_c1_c0'>
							<text class='index_fd2_0_c0_c0_c0'>快递代取</text>
							<text class='index_fd2_0_c0_c0_c1'>Express pickup</text>
							<image class='index_fd2_0_c0_c0_c2' mode="aspectFit" :src='STATIC_URL+"103.png"'></image>
						</view>
						<image class='index_fd2_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"105.png"'></image>
					</view>
					<view class='flex align-end self-center index_fd2_0_c2' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/release/release/release?tabs=2`">
						<view class='flex flex-direction flex-wrap align-stretch index_fd2_0_c0_c0'>
							<text class='index_fd2_0_c0_c0_c0'>外卖代取</text>
							<text class='index_fd2_0_c0_c0_c1'>Takeaway</text>
							<image class='index_fd2_0_c0_c0_c2' mode="aspectFit" :src='STATIC_URL+"103.png"'></image>
						</view>
						<image class='index_fd2_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"106.png"'></image>
					</view>
					<view class='flex align-end self-center index_fd2_0_c2' @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pages/release/release/release?tabs=3`">
						<view class='flex flex-direction flex-wrap align-stretch index_fd2_0_c3_c0'>
							<text class='index_fd2_0_c0_c0_c0'>校园跑腿</text>
							<text class='index_fd2_0_c0_c0_c1'>Running errands</text>
							<image class='index_fd2_0_c0_c0_c2' mode="aspectFit" :src='STATIC_URL+"103.png"'></image>
						</view>
						<image class='index_fd2_0_c0_c1' mode="aspectFit" :src='STATIC_URL+"107.png"'></image>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-center' @tap.stop="handleJumpDiy"
					data-type="navigateTo" :data-url="`/pages/index/centreCoupon/centreCoupon`">
					<image class='index_fd2_1_c0' mode="aspectFill" :src='STATIC_URL+"108.png"'></image>
				</view>
			</view>
			<official-account></official-account>

			<!---flex布局flex布局结束-->
			<benben-popup v-model="popupShow1715242688974" :mask="true" :mask-close-able="true" mode='center'>

				<!-- flex flex-direction flex-wrap align-stretch benben-flex-layout -->
				<view class="flex flex-direction  align-center justify-center benben-flex-layout index_flex_3">
					<image class='guanbi' mode="aspectFill" :src='STATIC_URL+"42.png"'
						@tap.stop="popupShow1715242688974 = false"></image>
					<image class='' style="max-height: calc(100% - 188rpx);" mode="widthFix"
						:src='detls.home_background'></image>
					<!-- <text class='index_fd3_0'>{{detal.follow_title}}</text>
                    <view class='flex flex-wrap align-center justify-center index_fd3_1'>
						<button class='index_fd3_1_c1' @tap.stop="quguanzhu">去关注</button>
                    </view> -->
					<button class='index_fd3_1_c1' @tap.stop="quguanzhu">去看看</button>
				</view>
			</benben-popup>
			<!--选择学校选择器开始 -->
			<benben-picker ref="benbenWritePickerCodepicker4" :visible.sync="pickerDiy1715242438727"
				:label.sync='schoolLable' :value.sync='schoolValue' :options='schoolType' mode='selector'
				default-type='aid' :mask-show='true' :timeout='true' :picker-height='88'
				:default-props='{"label":"name","value":"aid"}' @change="dizhi">
				<template #picker-header>
					<view class='flex flex-wrap align-center justify-between index_picker4_0'>
						<text class='index_picker4_0_c0' @tap="$refs.benbenWritePickerCodepicker4.cancel()">取消</text>
						<text class='index_picker4_0_c1'>选择学校</text>
						<text class='index_picker4_0_c2'
							@tap="$refs.benbenWritePickerCodepicker4.pickerConfirm()">确定</text>
					</view>
				</template>
			</benben-picker>
			<!--选择学校选择器结束 -->



		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"pickerDiy1715242438727": false,
				"popupShow1715242688974": false,
				"bannerIndexfd1_0": 0,
				"schoolType": [],
				"schoolLable": "",
				"schoolValue": "",
				"imgList": [],
				new_msg_num: 0,
				detal: '',
				detls: '',
			};
		},
		computed: {
			isLogin() {
				return this.$store.state.token == '' ? false : true;
			}
		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			async post6673ead3a1831() {
				// if(this.isLogin){
				let datadetail = await this.$api.get(global.apiUrls.post6673ead3a1831);

				if (datadetail.data.code != 1) {
					this.$message.info(datadetail.data.msg);
					return
				}
				let infodetail = datadetail.data.data;
				// console.log(infodetail,123)
				this.detls = infodetail
				// }
			},
			async quguanzhu() {
				if (this.detls.home_url_type == 0) {
					uni.navigateTo({
						url: this.detls.home_url
					})
				} else {
					uni.navigateTo({
						url: `/pages/benben-built-in/web-view/web-view?webPath=${encodeURIComponent(this.detls.home_url)}`
					})
				}
				this.popupShow1715242688974 = false
				// let res = await this.$api.get(global.apiUrls.post649039e86761b);
				// if (res.data.code != 1) {
				//     this.$message.info(res.data.msg);
				//     return
				// }
				// uni.navigateTo({ 
				// 	url: `/pages/benben-built-in/web-view/web-view?webPath=${encodeURIComponent(url)}` 
				// })
				this.popupShow1715242688974 = false
			},
			dizhi(vue) {
				console.log(vue, this.schoolLable, this.schoolValue)
				let data = {
					name: this.schoolLable,
					aid: this.schoolValue
				}
				uni.setStorageSync('schooLinfo', JSON.stringify(data))
			},
			together() {
				let aaa = [123, 44, 122]
				let bbb = aaa.sort()
				console.log(bbb, '数据')
				this.getde36e02b419726Func()
				this.getso66f98f91a240Func()
				this.getlb67386e4b6afaFunc()
				this.post649039e86761b()
				this.post6673ead3a1831()
			},
			//获取未读消息数量及最新消息
			async post649039e86761b() {
				//请求方法
				//数据验证
				if (this.isLogin) {
					let datadetail = await this.$api.get(global.apiUrls.post649039e86761b, {
						type: 1
					});

					if (datadetail.data.code != 1) {
						this.$message.info(datadetail.data.msg);
						return
					}
					let infodetail = datadetail.data.data;
					// console.log(infodetail,123)
					this.new_msg_num = infodetail
				} else {
					this.new_msg_num = 0
				}


			},
			//广告-广告列表
			async getde36e02b419726Func() {
				//请求方法
				//数据验证

				let dataimgList = await this.$api.get(global.apiUrls.post641e624160dd0, {
					operationadstype_id: '1'
				});

				if (dataimgList.data.code != 1) {
					this.$message.info(dataimgList.data.msg);
					return
				}
				let infoimgList = dataimgList.data;
				this.imgList = infoimgList.data

			},
			//查询会员是否关注公众号
			async getlb67386e4b6afaFunc() {
				//请求方法
				//数据验证
				if (this.isLogin) {
					let datadetal = await this.$api.get(global.apiUrls.post667386e4b6afa, {

					});

					if (datadetal.data.code != 1) {
						this.$message.info(datadetal.data.msg);
						return
					}
					let infodetal = datadetal.data;
					this.detal = infodetal.data
					// console.log(this.detal.is_follow == '0',1111111111)
					if (this.detal.is_follow == '0') {
						this.popupShow1715242688974 = true
					}
				}


			},
			//首页=》查询学校列表
			async getso66f98f91a240Func() {
				//请求方法
				//数据验证

				let dataschoolType = await this.$api.get(global.apiUrls.post666f98f91a240, {

				});

				if (dataschoolType.data.code != 1) {
					this.$message.info(dataschoolType.data.msg);
					return
				}
				let infoschoolType = dataschoolType.data;
				this.schoolType = infoschoolType.data
				if (!this.schoolValue) {
					this.schoolLable = this.schoolType[0].name
					this.schoolValue = this.schoolType[0].aid
					let data = {
						name: this.schoolLable,
						aid: this.schoolValue
					}
					uni.setStorageSync('schooLinfo', JSON.stringify(data))
				}

			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('190.png')) no-repeat, rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.index_flex_0 {
		// border-bottom: 1px solid #eee;
		background: url(image-path('190.png')) no-repeat;
		width: 750rpx;
		height: 194rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.index_fd0_1_c1_c1 {
		position: absolute;
		top: -20rpx;
		right: -14rpx;
	}

	.index_fd0_1_c1_c0 {
		width: 48rpx;
		height: 48rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.index_fd0_1_c1 {
		position: relative;
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.index_fd0_1_c0_c1 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.index_fd0_1_c0_c0 {
		width: 30rpx;
		height: 32rpx;
		margin: 0rpx 22rpx 0rpx 0rpx;
	}

	.index_fd0_1_c0 {
		background: #FFFFFF;
		border-radius: 36rpx 36rpx 36rpx 36rpx;
		width: 526rpx;
		height: 72rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.index_fd0_1 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		margin: auto 0rpx 24rpx 0rpx;
	}

	.index_fd0_0_c0_c1 {
		font-size: 32rpx;
		font-weight: 700;
		color: #fff;
		line-height: 45rpx;
		text-align: left;
		font-style: normal;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.index_fd0_0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.index_fd0_0 {
		height: 88rpx;
		padding: 20rpx 32rpx 20rpx 32rpx;
	}

	.index_flex_1 {
		margin: 0rpx 0rpx 32rpx 0rpx;
	}

	.index_numberfd1_0_c0 {
		background: #525050;
		position: absolute;
		bottom: 20rpx;
		right: 30rpx;
		width: 80rpx;
		height: 40rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.index_fd1_0 {
		width: 686rpx;
		height: 324rpx;
		border-radius: 24rpx;
	}

	.index_swiperDotUnselectedfd1_0 {
		border: 1px solid rgba(0, 0, 0, 0.3);
		background: rgba(0, 0, 0, 0.3);
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.index_swiperDotSelectedfd1_0 {
		border: 1px solid #00A7FF;
		background: #00A7FF;
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	::v-deep .index_swiperDotfd1_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.index_flex_2 {
		background: rgba(248, 248, 248, 1);
		background-size: 100% auto;
		border-radius: 32rpx 32rpx 0rpx 0rpx;
	}

	.index_fd2_1_c0 {
		width: 686rpx;
		height: 200rpx;
	}

	.index_fd2_0_c3_c0 {
		margin: 0rpx 15rpx 0rpx 0rpx;
	}

	.index_fd2_0_c2 {
		background: var(--benbenbgColor1);
		width: 333rpx;
		padding: 32rpx 30rpx 12rpx 30rpx;
		background-size: 100% auto;
		border-radius: 16rpx;
		box-shadow: 0rpx 6rpx 12rpx rgba(0, 0, 0, 0.1);
	}

	.index_fd2_0_c1_c0 {
		margin: 0rpx 25rpx 0rpx 0rpx;
	}

	.index_fd2_0_c0_c1 {
		width: 110rpx;
		height: 110rpx;
		margin-left: auto;
	}

	.index_fd2_0_c0_c0_c2 {
		width: 24rpx;
		height: 24rpx;
	}

	.index_fd2_0_c0_c0_c1 {
		color: #999999;
		font-size: 20rpx;
		font-weight: 400;
		line-height: 28rpx;
		margin: 8rpx 0rpx 44rpx 0rpx;
	}

	.index_fd2_0_c0_c0_c0 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 42rpx;
	}

	.index_fd2_0_c0_c0 {
		margin: 0rpx 32rpx 0rpx 0rpx;
	}

	.index_fd2_0_c0 {
		background: var(--benbenbgColor1);
		width: 333rpx;
		padding: 32rpx 30rpx 12rpx 30rpx;
		background-size: 100% auto;
		border-radius: 16rpx;
		box-shadow: 0rpx 6rpx 12rpx rgba(0, 0, 0, 0.1);
		margin: 0rpx 0rpx 20rpx 0rpx;
		box-sizing: border-box;
	}

	.index_fd2_0 {
		padding: 40rpx 32rpx 40rpx 32rpx;
	}

	.index_flex_3 {
		// background: linear-gradient(180deg, #FEE7D5 0%, #FFFFFF 28%, #FFFFFF 100%);
		max-width: 750rpx;
		min-width: 560rpx;
		height: 70vh;
		background-size: 100% auto !important;
		border-radius: 24rpx;
		position: relative;
	}

	.index_fd3_1_c1 {
		background: #FF8E21;
		border-radius: 49rpx 49rpx 49rpx 49rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor3);
		width: 240rpx;
		height: 96rpx;
		line-height: 94rpx;
		font-weight: 500;
		box-shadow: 0rpx 1rpx 3rpx rgba(74, 74, 74, 0.13)rpx rgba(74, 74, 74, 0.13);
		margin: 32rpx auto 0rpx;
		// position: absolute;
		// bottom: 0;
		// left: 50%;
		// transform: translateX(-50%);
	}

	.index_fd3_1_c0 {
		background: #F3F3F3;
		border-radius: 49rpx 49rpx 49rpx 49rpx;
		font-size: 32rpx;
		color: var(--benbenFontColor0);
		width: 240rpx;
		height: 96rpx;
		line-height: 96rpx;
		font-weight: 500;
		box-shadow: 0rpx 1rpx 3rpx rgba(74, 74, 74, 0.13)rpx rgba(74, 74, 74, 0.13);
	}

	.index_fd3_1 {
		margin: 0rpx 0rpx 68rpx 0rpx;
	}

	.index_fd3_0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #424654;
		margin: 95rpx 0rpx 72rpx 0rpx;
		text-align: center;
		padding: 0 24rpx;
	}

	.index_picker4_0_c2 {
		color: #FF8E21;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 40rpx;
		text-align: left;
		font-style: normal;
	}

	.index_picker4_0_c1 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 700;
		line-height: 50rpx;
		text-align: left;
		font-style: normal;
	}

	.index_picker4_0_c0 {
		color: #999999;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
		text-align: left;
		font-style: normal;
	}

	.index_picker4_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 24rpx 24rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		height: 110rpx;
	}

	.guanbi {
		width: 38rpx;
		height: 38rpx;
		margin: 0rpx 0 32rpx auto;
		// position: absolute;
		// right: 0;
		// top: 0;
	}
</style>